package com.trkj.dao.wxy;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojo.ExamArrange;
import com.trkj.pojo.ExamPaper;
import com.trkj.pojo.QuestionBank;
import com.trkj.vo.wxy.ExamPageVo;
public interface ExamDao extends CrudRepository<ExamPaper, Long> {
	//模糊查询
	@Query(nativeQuery=true,value="select * from EXAM_PAPER e where e.CLASS_SJ_NAME like ?1 or e.EP_ID like ?1")
	public List<ExamPageVo> queryByeName(String classSjName);
	
	//多表查询分页
	@Query("select e,q from ExamPaper e  inner join e.questionBank q")
	public List<Object[]> queryByExam(Pageable p);
	
	//单表分页
	@Query("from ExamPaper e")
	public List<ExamPaper> queryByPage(Pageable p);
	
	//编辑获取试卷名称
	@Query("select e from ExamPaper e where e.classSjName=?1")
	public ExamPaper queryByExamPaperClassSjName(String classSjName);
}
